import form from "./form"
import search from "./search"
import setRole from "./setRole"
import formGet from "./formGet"
// 登录
import API from "@/api"
const container = {
    form,
    search,
    setRole,
    formGet
}
export function system(moduleName,moduleAss,moduleCore){
    let bones={
        namespaced: true,
        state: {
            API: API.admin[moduleName]
        }
    };
    let index=['state', 'mutations', 'actions', 'getters'];
    for (let i of moduleAss){
        for(let j of index){
            bones[j]=Object.assign({},bones[j], container[i][j], moduleCore[j] || {});
            
        }
        
    }
    return bones;
}

export function reception(moduleName,moduleAss,moduleCore){
    let bones={
        namespaced: true,
        state: {
            API: API.reception[moduleName]
        }
    };
    let index=['state', 'mutations', 'actions', 'getters'];
    for (let i of moduleAss){
        for(let j of index){
            bones[j]=Object.assign({},bones[j], container[i][j], moduleCore[j] || {});
            
        }
        
    }
    return bones;
}